package com.alipay.app.groupmeal.standard.util;

import android.app.ActivityManager;
import android.content.Context;

public class ActivityUtil {

    public static boolean isActivityRunning(Context context, String activityName) {
        ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        for (ActivityManager.RunningTaskInfo task : activityManager.getRunningTasks(Integer.MAX_VALUE)) {
            if (task.topActivity.getClassName().equals(activityName)) {
                return true;
            }
        }
        return false;
    }
}

